import {createRouter, createWebHashHistory} from "vue-router";
import Home from "@/views/Home.vue";
import Category from "@/views/Category.vue";
import Cart from "@/views/Cart.vue";
import User from "@/views/User.vue";
import GoodDetail from "@/views/GoodDetail.vue";
import Login from "@/views/Login.vue";
import Setting from "@/views/Setting.vue";

// 使用createRouter创建路由实例
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            component: Home
        },
        {
            path: '/home',
            name: 'home',
            component: Home
        },
        {
            path: '/category',
            name: 'category',
            component: Category
        },
        {
            path: '/cart',
            name: 'cart',
            component: Cart
        },
        {
            path: '/user',
            name: 'user',
            component: User
        },
        {
            path: '/good-detail',
            name: 'goodDetail',
            component: GoodDetail
        },
        {
            path: '/login',
            name: 'login',
            component: Login
        },
        {
            path: '/user',
            name: 'user',
            component: User
        },
        {
            path: '/setting',
            name: 'Setting',
            component: Setting
        }
    ]
})
export default router;
